#ifndef GLOBALS_H
#define GLOBALS_H

/***************
GLOBAL CONSTANTS
***************/

//GlWidget constants
static const float g_CONTROL_SIZE = 4.0f;
static const int g_NUM_BB_DIVISIONS = 1;


/***************
GLOBAL FUNCTIONS
***************/
static int g_random(int min, int max) {
    if(min > max){
        return 0;
    }
	int range = (max - min) + 1;
	return min + (int)(range*rand() / (RAND_MAX + 1.0));
}

/* max
*	Returns the max of two floats.
*Parameters:
*	float a	-> The first float
*	float b	-> The second float
*Returns:
*	float	-> The maximum
*/
static float g_max(float a, float b) {
	return (b<a)?a:b;
}

/* min
*	Returns the min of two floats.
*Parameters:
*	float a	-> The first float
*	float b	-> The second float
*Returns:
*	float	-> The minimum
*/
static float g_min(float a, float b) {
	return (b<a)?b:a;
}

static float g_abs(float a) {
	return (a>0)?a:-a;
}

#endif //GLOBALS_H